package com.PVZ.event;

import com.PVZ.model.Entity;
import com.PVZ.model.emuns.EventType;
import lombok.Getter;
import lombok.Setter;

import java.util.List;

/**
 * Created by @Author: kabuda on @Date: 2021/5/20 21:16
 */
@Getter
@Setter
public class AttackEvent extends Event{

    private Entity attacker;

    private List<Entity> enemies;

    /**
     * 创建攻击事件
     * @param attacker 攻击者
     * @param enemies 敌人
     */
    public AttackEvent(Entity attacker,List<Entity> enemies){
        eventType = EventType.ATTACK;
        this.attacker = attacker;
        this.enemies = enemies;
    }

    public AttackEvent(Entity attacker) {
        eventType = EventType.ATTACK;
        this.attacker = attacker;
        this.enemies = null;
    }
}
